package com.bfb;

import com.bfb.R;
import com.bfb.adapters.ImageAdapter;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Gallery;


/**
 * This class is used to create different tabs with different images and resources.
 * a new instance of that class creates a new activity with new gallery of images
 * 
 * @author 
 * 		Hadeer Diwan (hadeer.diwan@gmail.com)
 *
 */
public class IngredientsActivity extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.gallery_layout);
		Bundle extras = getIntent().getExtras();

		int[] ingredient_drawables = extras.getIntArray("ingredient_drawables");
		String[] ingredient_names = extras.getStringArray("ingredient_names");
		String tabName = extras.getString("tabName");

		Gallery gallery = (Gallery) findViewById(R.id.gallery);
		ImageAdapter ingredientImageAdapter = new ImageAdapter(
				getBaseContext(), ingredient_names, ingredient_drawables,
				tabName);
		gallery.setAdapter(ingredientImageAdapter);
		gallery.setOnItemClickListener(ingredientImageAdapter);

	}

}
